package exercise1;
import java.util.Scanner;
public class No5_1 {
    public static void main(String []args)
    {
        System.out.println("Enter a integer, the input ends if it is 0:");
        Scanner input=new Scanner(System.in);
        double zheng=0;
        double fu=0;
        double total=0;
        double number=0;
        while (true)
        {
            int a=input.nextInt();
            if (a==0)
            {
                break;
            }
            if (a<0)
            {
                fu++;
                total=total+a;
                number++;
            }
            if (a>0)
            {
                zheng++;
                total=total+a;
                number++;
            }
        }
        System.out.println("The number of positives is "+zheng);
        System.out.println("The number of negatives is "+fu);
        System.out.println("The total is "+total);
        System.out.println("The average is "+(total/number));
    }
}
